/**
 * 文件的面板：用于文件展示、编辑..
 * 有FilePanel.Header, FilePanel.Body 2个子组件
 * FilePanel.Body组件默认有padding，可以通过参数：noPadding, onlyPaddingBottom控制
 */

import React from 'react';
import './index.scss';

const FilePanel = (props) => {
  const { className, ...others } = props;
  return <div className={`file-panel-normal file-panel-src ${className || ''}`} {...others} />;
};
FilePanel.Header = (props) => (
  <div className={` file-panel-src-header ${props.className || ''}`}>{props.children}</div>
);
FilePanel.Body = (props) => {
  const { noPadding, onlyPaddingBottom, className, children } = props;
  return (
    <div
      className={`file-panel-src-body ${className || ''} ${
        onlyPaddingBottom ? 'onlyPaddingBottom' : ''
      } ${noPadding ? 'noPadding' : ''}`}
    >
      {children}
    </div>
  );
};

export default FilePanel;
